<?php
// List all domains, including posible subdomains (e.g. www.) that are allowed to submit
// requests to this script and the domains of any posible recipient email address.

$validReferrers = array('televisiontunes.com', 'www.televisiontunes.com', 'jayzoo.com', 'www.jayzoo.com', 'philosophyfactory.ca', 'www.philosophyfactory.ca', '');

/////////////////////////////////////////////////////////////////////////////////


$HTTP_REF = getenv('HTTP_REFERER');
$a = preg_replace("/https?:\/\//","",$HTTP_REF);
$a = explode("/",$a);
$a = array_shift($a);

if(!in_array($a,$validReferrers)) {
	print "<p class=err>Invalid Referrer '$a'</p><p>Referrer does not have permission to access this Formmail script.</p>";
	exit;
}

?>